1. Field of the Invention
The present invention relates to animation data which is processed as images in real time, and to an image processing method and image processing program using same.
2. Description of the Related Art
In a home video game device, or the like, moving images of characters or objects in a game are created in real time, in synchronism with the development of the game. In image processing in a game device of this kind, it is necessary for the positions of objects in the game to be moved in response to operational input signals from an operator, and for images corresponding to these moved positions to be drawn into a frame memory, which is an image memory, within a short time period, namely, the frame time period.
2D animation technology, which generates animated images by positioning two-dimensional images (sprites) within a frame and causing these images to change with each frame, is capable of generating predetermined animated images by means of relatively simple image processing, and it is therefore used widely in home video game devices, portable game devices, and the like. 2D animation is also known as xe2x80x98sprite animationxe2x80x99. In this specification, both terms xe2x80x982D animationxe2x80x99 and xe2x80x98sprite animationxe2x80x99 are used interchangeably, and have the same meaning.
FIG. 1 is a diagram illustrating a conventional 2D animation method. FIG. 1A is a frame stream showing an example of consecutive frames F0, F1, F2, . . . in 2D animation. In each frame, an image consisting of a plurality of sprites is generated, and this image changes gradually with each frame in order to represent a particular movement. FIG. 1B shows examples of individual sprites. The object in frame F0 is constituted by a plurality of sprites. For example, sprite SP0 is the head portion of the object, sprite SP1 is an eye, sprite SP2 is a hand, and so on. Each sprite has a plurality of images, including a forward image, lateral images, and the like, in terms of the head region. Images can be generated by appropriately selecting the pre-designed sprites and attaching them together in the frame.
In conventional 2D animation using sprites, a sprite consisting of a two-dimensional image is used as the basic element of the image, and a prescribed image is produced by selecting sprites and placing them in prescribed positions within the frame according to a game program.
On the other hand, video games are now being developed by designers, who design images which incorporate movement of characters within the game, and programmers who design game programs which correspond to game stories. With the massive development of video games in recent years, it has become essential to divide the workload of designers and programmers.
A designer creates sprites SP forming components which make up objects, such as characters, and the like, as illustrated in FIG. 1B, and supplies these sprites to the programmer in a prescribed data format. The programmer then designs a program which selects the aforementioned sprites appropriately, and positions these sprites in a frame (display screen) in order to reproduce movements of game objects specified by the programmer according to a game program which controls the game story. Consequently, the ultimate sprite animation can only be verified finally when the game program designed by the programmer is executed.
In video games, in addition to displaying animated images, it is also necessary to generate sounds, and the like, in synchronism with these animated images. Therefore, in a conventional game program, it has been possible to provide a game output containing synchronized images and sound, by generating animated images using sprites and generating sound which is synchronized to these images.
However, the essential objective of a designer is not to design individual sprites, but to design animated images based on objects (or characters) made up of a plurality of sprites. Moreover, the designer also designs the whole game output, including decisions on the timings in the animated images at which sound or music should be inserted. Consequently, in a conventional game development environment, in which a designer designs sprites images only, and conveys the movements of objects made up of a plurality of these sprites to a programmer, by word of mouth or in writing, whereupon the programmer reproduces these movements in a game program, which are then checked by the designer, and require subsequent revisions to be made, it has been very difficult for designers to achieve sprite animation which fully reflects their design aims.
Furthermore, the development of geometry processor functions for selecting sprites and positioning them within in a frame, in a game program, has led to further complexity in game programs which controls complicated game stories.
Moreover, in image processing using sprites in a game program, for example, in a scene where a character blinks when facing in a forward direction and a scene where a character blinks when facing to the side, although the same eye operation, namely, blinking, is involved, it is necessary to have a program which generates respective animations based on the eye sprites for each of the scenes, and hence the game program expands enormously in size.
Therefore, it is an object of the present invention to provide an image processing method and image processing program for animation, and animation data for realizing same, whereby it is possible to design animated images which conform more closely to the intentions of the designer, in an animation (sprite animation) process.
It is a further object of the present invention to provide animation data designed principally by a designer, in an animation process, which is able to represent both animated images of a plurality of sprites and animated images of an object constituted by a combination of these sprites, and to provide an image processing method and image processing program using this data.
It is a further object of the present invention to provide animation data capable of supplying animation of respective sprites and animation of objects consisting of a plurality of sprites, in an animation process, simply by specifying data relating to a desired scene in a game program which controls a complicated game story, and to provide an image processing method and image processing program using this data.
It is a further object of the present invention to provide animation data having a relatively small data volume, which is capable of realizing animation relating to a plurality of scenes, in an animation process, and to provide an image processing method and image processing program using this data.
It is a further object of the present invention to provide animation data which enables prescribed events to be synchronized with prescribed timings during animation, and to provide an image processing method and image processing program using this data.
In order to achieve the aforementioned objects, a storage medium for a game relating to the present invention contains: (1) a game program for calling up drawing functions for prescribed scenes in accordance with the progress of the game; (2) animation data including sprite data forming two-dimensional still images, and motion data capable of generating animations by causing the sprites to change with each frame; and (3) a drawing program for generating rendering data (drawing commands) positions, colours, texture co-ordinates, and the like, for each sprite in a frame (display screen), according to the animation data specified by the drawing function.
In general terms, animation data is data capable of generating moving images (animations) of characters as intended by a designer, and this animation data can be developed separately from the game program. Moreover, a drawing program is a generic drawing library capable of interpreting the animation data and generating rendering data, including position data for each sprite in a frame, for each respective frame. A game program simply calls up a drawing function (library function) which specifies animation data so as to be capable of causing the drawing library to interpret the specified animation data and generate rendering data accordingly. Therefore, the programmer is able to design a game program which generates particular scenes, without being aware of the animated images of the characters (or objects). The programmer can cause an animation created by the designer to be displayed, simply by designating the required drawing function in the game program. Moreover, the designer is able to pursue his or her design, including animation of the characters, as he or she pleases, in a separate environment for the development of the game program.
In one aspect of the present invention, conventional sprites are called cells, and an object or character constituted by a plurality of cells is called a xe2x80x98cell spritexe2x80x99. Furthermore, cell sprite data is constituted by a plurality of cell data and main data relating to the whole cell sprite. This main data comprises global co-ordinates within the frame, for example, whilst the cell data comprises local co-ordinates within the cell sprite, and texture data which is to be attached to the cell. Accordingly, it is possible to generate position data and texture data, and the like, for a cell sprite in a frame (display screen), on the basis of cell sprite data. Therefore, it is possible to generate rendering data for generating still images within a single frame, by means of the relevant cell sprite data.
In a further aspect of the present invention, data for generating animated images comprises cell stream data wherein cell data is caused to change in a stream of consecutive frames, and cell sprite motion data wherein the main data for the cell sprite is caused to change in a stream of frames. The cell stream data is data for changing one cell or a plurality of cells in a prescribed manner, in accordance with the frame number, and as one method for achieving this, it is possible to incorporate data indicating which cell data changes, and in what manner, at each frame. Alternatively and more desirably, the cell stream data only contains differential data indicating required changes with respect to the cell sprite data in the preceding frame, this differential data being assigned to frames which require changes. Furthermore, it is also possible to set a plurality of cell stream data respectively and independently, and to set the start and end frames, total frame number, and the like, in an independent fashion. Consequently, by using a cell stream list which combines a plurality of cell stream data, it is possible to achieve a large number of animations, efficiently, and with a high degree of freedom. For example, by combining a cell stream list relating to blinking of the eyes with a plurality of cell stream lists wherein the head region is moved in different ways, in a prescribed frame correlation, it is possible to achieve a large number of animations, efficiently, and with a high degree of freedom.
The sprite motion data wherein the main data for the cell sprite is changed is data which causes a cell sprite constituted by a plurality of cells to change in a prescribed manner. As one method for achieving this, it is possible to incorporate data for changing the main data for each frame. Alternatively, the cell sprite motion data may contain only differential data indicating changes required with respect to the preceding frame, this differential data being assigned to the frame requiring these changes. Moreover, more desirably, the cell sprite motion data may comprise data for changing the main data for every prescribed number of frames. Since changes in a cell sprite, which comprises a group of several cells, can be determined with relatively high precision by means of linear interpolation, it is possible to generate main data for each frame, simply from the data for each prescribed number of frames.
In a further aspect of the present invention, the drawing program generates rendering data including position data for cells within a frame (display screen), for each frame, in accordance with animation data comprising cell sprite data, cell stream data and cell sprite motion data. This drawing program executes a drawing function specifying cell sprite data (or a cell stream list consisting of a plurality of cell stream data) and cell sprite motion data. This drawing function is a subroutine which is called up from the game program. The drawing program is a low level element program forming a drawing library, which supports the game program and cell sprite data group.
In order to achieve the aforementioned objects, the first aspect of the invention is a storage medium storing animation data for animations whereby moving images are generated by positioning cells having two-dimensional images within a frame, wherein the animation data comprises: cell sprite data including a plurality of cell data each of which contains, at the least, position data and texture for the cell; and motion data including cell stream data each of which contains change information for the cell data in accordance with a series of frames.
By means of a designer creating the aforementioned animation data, it is possible to design a final animation, without depending on a game program.
A desirable embodiment according to the first aspect of the present invention is a storage medium for storing animation data, wherein a cell sprite is constituted by the plurality of cells, and the cell sprite data further comprises main data contains global positional information for the cell sprite within the frame.
A further desirable embodiment is a storage medium for storing animation data according to the aforementioned embodiment, wherein the motion data also comprises cell sprite motion data containing change information for the main data in accordance with a series of frames.
In order to achieve the aforementioned objects, a second aspect of the present invention is a storage medium storing: animation data according to the first aspect of the invention; a game program for implementing a game in response to operational inputs from an operator; and a drawing program for generating cell sprite data for the frame currently under processing by changing the cell sprite data on the basis of the motion data designated by the game program, and for generating rendering data containing position data for the cells in the frame from the aforementioned generated cell sprite data.
This storage medium stores animation data for realizing animations created by the designer, and a game program, in a separate fashion. Therefore, the designer is able to design animations independently, without relying on a game program, and the programmer is able to insert particular scenes within a game story, by using the drawing program.
In order to achieve the aforementioned objects, a third aspect of the present invention is an image processing system comprising the storage medium according to the third aspect of the invention; and rendering unit for generating image data for pixels for each frame, in accordance with the rendering data.
In order to achieve the aforementioned objects, a fourth aspect of the present invention is an image processing method for generating rendering data for each frame, by referring to the animation data according to the first aspect of the invention, comprising the steps of: generating cell sprite data for the frame currently under processing by changing cell sprite data on a basis of designated motion data; generating position data for each cell in the frame, in accordance with the cell sprite data for the frame currently under processing; and rendering to generate image data for pixels for each frame, in accordance with rendering data including the position data for each cell within the frame, and texture data for each cell.
In order to achieve the aforementioned objects, a fifth aspect of the present invention is a storage medium storing an image processing program for causing a computer to execute a procedure for generating rendering data for each frame, by referring to animation data according to the first aspect of the invention, the procedure comprising the steps of: generating cell sprite data for the frame currently under processing by changing cell sprite data on a basis of designated motion data; and generating position data for each cell in the frame, in accordance with the cell sprite data thus generated for the frame currently under processing.